package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.ISystemLogService;
import cn.wolfcode.crm.util.PageResult;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("systemLog")
public class SystemLogController {
    @Autowired
    private ISystemLogService systemLogService;

    /**
     * 系统日志视图
     * @return
     */
    @RequiresPermissions(value={"systemLog:view","日志视图"},logical = Logical.OR)
    @RequestMapping("view")
    public String view() {
        return "systemLog/systemLog";
    }

    /**
     * 系统日志查询
     * @param qo
     * @return
     */
    @RequiresPermissions(value={"systemLog:query","日志列表"},logical = Logical.OR)
    @RequestMapping("query")
    @ResponseBody
    public PageResult query(QueryObject qo) {
        return systemLogService.query(qo);
    }
}
